package com.zhao.controller;

import com.zhao.service.ICategoryService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

@Controller
@RequestMapping("/api/index/category")
public class CategoryController extends BaseController{
    @Resource
    ICategoryService categoryService;

    @RequestMapping(value = "/all",method = RequestMethod.GET)
    @ResponseBody
    public Map<String,Object> findAllCategory() {
        return response(categoryService.findAll());
    }
}
